﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Adex;
using MediaMonitor.Common;
using System.Data;
using System.Data.SqlClient;
using System.IO;

namespace MediaMonitor.SiteFiles
{
    public partial class Outdoor_Street : Adex.BasePage
    {
        public string curVideo;
        public int width = 600;
        public int height = 700;

        public string filename;

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {

                width = Utility.ToInt(Utility.GetRequestedVal("w", width.ToString())) - 20;
                height = Utility.ToInt(Utility.GetRequestedVal("h", height.ToString())) - 25;

                string outdoorStreetFile = Utility.GetRequestedVal("file", "");


                if (CheckOutdoorStreetFileAvailability(outdoorStreetFile))
                {
                    filename = "../outdoor-street/" + outdoorStreetFile;
                    //width = 600;
                    //height = 700;
                    pnlVideo.Visible = true;
                    pnlNoVideo.Visible = false;
                }
                else
                {
                    pnlNoVideo.Visible = true;
                    lblMsg.Text = "Picture not found";
                    pnlVideo.Visible = false;
                }


            }
        }

        private bool CheckOutdoorStreetFileAvailability(string fileName)
        {
            return File.Exists(Server.MapPath("../outdoor-street/" + fileName));
        }
    }
}